home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-03 / qbasicpg.zip / COM2_EX.BAS < prev    next >
BASIC Source File  |  1988-09-17  |  317b  |  16 lines

  1. '
  2. ' *** COM2_EX.BAS - COMMON statement programming example
  3. '
  4. DIM X(1 TO 50)
  5. COMMON X(), N
  6.  
  7. PRINT
  8. PRINT "Now executing file com2_ex.bas, reached through a CHAIN command"
  9. IF N > 0 THEN
  10.    Sum = 0
  11.    FOR I = 1 TO N
  12.       Sum = Sum + X(I)
  13.    NEXT I
  14.    PRINT "The average of the values is"; Sum / N
  15. END IF
  16.